<template>
    <div>
        <h1>添加检测记录</h1>
        <el-form :model="form" ref="form" :data="form" :rules="rules" label-width="120px"  >
            <el-form-item label="检测时间">
                <el-date-picker v-model="form.checkDate" type="date" placeholder="检测时间" prop="checkDate"></el-date-picker>     
            </el-form-item>
            <el-form-item label="核酸检测结果">
                <el-radio-group v-model="form.HS">
                    <el-radio :label="0">阴性</el-radio>
                    <el-radio :label="1">阳性</el-radio>
                </el-radio-group>
            </el-form-item>
            <el-form-item label="CT检测结果">
                <el-radio-group v-model="form.CT">
                    <el-radio :label="0">阴性</el-radio>
                    <el-radio :label="1">阳性</el-radio>
                </el-radio-group>
            </el-form-item>
        </el-form>
    </div>
</template>
<script>
  export default {
    data() {
      return {
          pickerOptions: {
            disabledDate(time) {
                return time.getTime() > Date.now();
            },
          shortcuts: [{
            text: '今天',
            onClick(picker) {
              picker.$emit('pick', new Date());
            }
          }, {
            text: '昨天',
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24);
              picker.$emit('pick', date);
            }
          }, {
            text: '一周前',
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit('pick', date);
            }
          }]
        },
        
        form: {
          checkDate: '',
          HS:'',
          CT:'',
        },
        rules:{
          checkDate: 
            { required: true, message: '请输入检测日期', trigger: 'blur' },
        }
      }
    },
    methods: {
      onSubmit() {
        console.log('submit!');
      },
      handleEdit(){
          this.$router.push({
              path:'patient/add_check'
          })
      }
    }
  }
</script>